function Block(){
    this.upDivWrap = null
    this.downDivWrap = null
    this.downHeight =baseObj.randomNum(0,150)           //随机生成下方管道长度  Math.lunden()  0-1之间的随机数
    this.gapHeight = baseObj.randomNum(150,160)
    this.upHeight = 312-this.downHeight - this.gapHeight

    //生成管道
    this.creatDiv = function(url,height,positionType,left,top){
        var newDiv = document.createElement('div')
        newDiv.style.width = '62px'
        newDiv.style.height = height
        newDiv.style.position = positionType
        newDiv.style.left = left
        newDiv.style.top = top
        newDiv.style.backgroundImage = url

        return newDiv
    }


    this.creatBlock = function(){
        var upDiv1 =this.creatDiv('url(img/up_mod.png)',this.upHeight+'px')             //创建mod管道体
        var upDiv2 =this.creatDiv('url(img/up_pipe.png)','60px')             //创建管道口          
        this.upDivWrap = this.creatDiv(null,null,'absolute','450px')                    //创建一个包裹管道体和管道口的容器，之后搬运的时候直接搬运这个容器
        this.upDivWrap.appendChild(upDiv1)
        this.upDivWrap.appendChild(upDiv2)


        //让上方管道出现在页面上
        jsWrapBg.appendChild(this.upDivWrap)
    }
}

